package com.icangya.DAO.impl;

import com.icangya.DAO.IRwShopSharesDAO;
import com.icangya.domain.Admin;
import com.icangya.domain.RwShopShares;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class RwShopSharesDAOImpl extends  BaseDAO<RwShopShares> implements IRwShopSharesDAO {

    Logger logger = LoggerFactory.getLogger(this.getClass());

    //根据用户id获取他的股份记录
    @Override
    public RwShopShares getRwShopSharesByUserId(long userid) {
        String hql=" FROM RwShopShares ss where ss.userid=? ";
        List<RwShopShares> list=(List<RwShopShares>) getHibernateTemplate().find(hql,userid);
        if(list.size()>0)
            return list.get(0);
        return null;
    }

}
